#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <string>
#include <string.h>
#include <stdio.h>
using namespace std;
class MyClass
{
public:
	char name[110];
	int a;
	int b;
	int flag;
	MyClass() 
	{
		flag = true;
	}
};
int main()
{
	int n;
	cin >> n;
	MyClass *A = new MyClass[n];
	for (int i = 0; i < n; i++)
	{
		cin >> A[i].name >> A[i].a >> A[i].b;
		if (A[i].a < 15 || A[i].a > 20 || A[i].b < 50 || A[i].b > 70)
			cout << A[i].name << endl;
	}
	system("PAUSE");
	return 0;
}